package com.yami.shop.cp.comment.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yami.shop.cp.comment.dto.CollaborativePurchaseMergerDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author xch
 * @since 2021-06-23
 */
@Data
@TableName("tz_collaborative_purchase_addr")
public class CollaborativePurchaseAddr implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 协同采购地址id
     */
    private Long id;

    /**
     * 协同采购id
     */
    private String collaborativePurchaseId;

    /**
     * 省id
     */
    private Long provinceId;

    /**
     * 省
     */
    private String province;

    /**
     * 市id
     */
    private Long cityId;

    /**
     * 市
     */
    private String city;

    /**
     * 区id
     */
    private Long areaId;

    /**
     * 区
     */
    private String area;

    /**
     * 详细地址
     */
    private String address;

    /**
     * 邮编
     */
    private String postCode;

    /**
     * 收件人
     */
    private String receiver;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 预留字段
     */
    private String reserved;

    /**
     * 预留字段1
     */
    private String reserved1;

    /**
     * 预留字段2
     */
    private String reserved2;

    /**
     * 预留字段3
     */
    private String reserved3;

    /**
     * 预留字段4
     */
    private String reserved4;

    /**
     * 获取采购单地址
     *
     * @return CollaborativePurchaseAddr
     */
    public static CollaborativePurchaseAddr getCollaborativePurchaseAddr(CollaborativePurchaseMergerDto collaborativePurchaseMergerDto) {
        CollaborativePurchaseAddr collaborativePurchaseAddr = new CollaborativePurchaseAddr();
        collaborativePurchaseAddr.setArea(collaborativePurchaseMergerDto.getArea());
        collaborativePurchaseAddr.setAreaId(collaborativePurchaseMergerDto.getAreaId());
        collaborativePurchaseAddr.setAddress(collaborativePurchaseMergerDto.getAddress());
        collaborativePurchaseAddr.setProvince(collaborativePurchaseMergerDto.getProvince());
        collaborativePurchaseAddr.setCity(collaborativePurchaseMergerDto.getCity());
        collaborativePurchaseAddr.setCityId(collaborativePurchaseMergerDto.getCityId());
        collaborativePurchaseAddr.setProvinceId(collaborativePurchaseMergerDto.getProvinceId());
        return collaborativePurchaseAddr;
    }

}
